//
//  FindTableViewCell.m
//  
//
//  Created by 郭明皓 on 15/10/24.
//
//

#import "FindTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
#import "DKNightVersion.h"
@implementation FindTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)dealloc
{
    [_area release];
    [_images release];
    [_titleLable release];
    [_descLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}
- (void)create
{
    [DKNightVersionManager addClassToSet:self.class];
    self.nightBackgroundColor = UIColorFromRGB(0x343434);

    self.images = [[UIImageView alloc]init];
    [self.contentView addSubview:self.images];
    [_images release];
    self.images.layer.cornerRadius = 10;
    self.images.layer.masksToBounds = YES;
    
    self.titleLable = [[UILabel alloc]init];
    [self.contentView addSubview:self.titleLable];
    [_titleLable release];
    self.titleLable.textColor = [UIColor whiteColor];
    self.titleLable.font = [UIFont fontWithName:@"Helvetica-Bold" size:18];
    
    self.descLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.descLabel];
    [_descLabel release];
    self.descLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
    self.descLabel.textColor = [UIColor whiteColor];
    
    self.area = [[UILabel alloc]init];
    [self.contentView addSubview:self.area];
    [_area release];
    self.area.textColor = [UIColor whiteColor];
    self.area.font = [UIFont fontWithName:@"Helvetica-Bold" size:15];
    
//    self.areaView = [[UIView alloc]init];
//    [self.contentView addSubview: self.areaView];
//    [_areaView release];
//    self.areaView.backgroundColor = [UIColor yellowColor];
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.images.frame = CGRectMake(5, 3, WIDTH - 10, self.contentView.frame.size.height - 6);
    self.titleLable.frame = CGRectMake(10, 140, WIDTH - 50, 25);
    self.descLabel.frame = CGRectMake(10, 165, WIDTH - 50, 25);
//    self.areaView.frame = CGRectMake(WIDTH - 40, 140, 40, 30);
    self.area.frame = CGRectMake(WIDTH - 50, 140, 40, 30);
}
@end
